import 'package:aio/aio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:app/src/ui/app_ui.dart';
import 'package:app/src/utils/image_path_utils.dart';
import '../helper/route_helper.dart';

///启动页
class LaunchRoute extends StatefulWidget {
  @override
  _LaunchState createState() => _LaunchState();
}

class _LaunchState extends State<LaunchRoute> {
  @override
  void initState() {
    super.initState();
    Future.delayed(Duration(seconds: 2)).then((value) {
      AppRouteHelper.goMainRoute(context, isEnableFastGo: false);
    });
  }

  @override
  Widget build(BuildContext context) {
    px.init(context);
    return Material(
        color: AppColors.backgroundColorWithLaunch,
        child: Padding(
          padding: EdgeInsets.only(top: px.y(300)),
          child: Align(
            child: Hero(
              tag: AppUi.hero_tag_launch,
              child: Image.asset(
                ImagePathUtils.getImageLogo(),
                width: 200,
                height: 200,
              ),
            ),
            alignment: Alignment.topCenter,
          ),
        ));
  }
}
